#include "BlueprintMainFunctionLoader.h"
#include "tinyxml/tinyxml.h"
#include "BlueprintScriptLibrary/RegistAction.h"
#include "GraphBase.h"

void BlueprintMainFunctionLoader::LoadFile(std::string file)
{
    TiXmlDocument doc;
    bool bLoad = doc.LoadFile(file.data());
    TiXmlElement* root = doc.RootElement();

    if (strcmp(root->Value(), "MainFunction") != 0)
        return;
    TiXmlElement* e = root->FirstChild()->ToElement();
    while (e != nullptr)
    {
        BlueprintScriptLibrary::Object* obj =BlueprintScriptLibrary::BlueprintDataPool::GetInstance()->createInstFuncs[e->Value()]();
        GraphBase* g = dynamic_cast<GraphBase*>(obj);
        vct_gbs.push_back(g);
    }
}

